{% comment %}
<!--
  Copyright (C) 2008 ZHENG Zhong <http://www.zhengzhong.net/>
  
  Created on 2008-10-31.
  $Id$
-->
{% endcomment %}

<!-- hottest movies _____________________________________________________________________________-->

<div class="section">

  <h2>Hottest movies</h2>
  
  <table class="sidebar_table">
    <tbody>
      {% for movie in sidebar_.top_movies %}
        <tr>
          <td class="image" style="width:1%;">
            <a href="{{webapp_}}/movie/{{movie.key.id}}/">
              {% if movie.has_poster %}
                <img src="{{webapp_}}/movie/{{movie.key.id}}/poster/"
                     alt="{{movie.name|escape}}"
                     title="{{movie.name|escape}}"/>
              {% else %}
                <img src="{{static_}}/images/movie_no_poster.jpg"
                     alt="{{movie.name|escape}}"
                     title="{{movie.name|escape}}"/>
              {% endif %}
            </a>
          </td>
          <td class="text">
            <div class="name">
              <a href="{{webapp_}}/movie/{{movie.key.id}}/">{{movie.name|escape}}</a>
            </div>
            <div class="information">
              <img src="{{static_}}/images/hot_time_icon.gif" alt="Hot ratio"/>
              Hot time: {{movie.hot_seconds}}s
            </div>
            <div class="information">
              <img src="{{static_}}/images/hot_ratio_icon.gif" alt="Hot ratio"/>
              Hot ratio: {{movie.hot_ratio_per_mille}}&permil;
            </div>
          </td>
        </tr>
      {% endfor %}
      <tr>
        <td class="foot_link" colspan="2">
          <a href="{{webapp_}}/movies/">more &#187;</a>
        </td>
      </tr>
    </tbody>
  </table>

</div>

<!-- hottest users ______________________________________________________________________________-->

<div class="section">

  <h2>Hottest users</h2>
  
  <table class="sidebar_table">
    <tbody>
      {% for user in sidebar_.top_users %}
        <tr>
          <td class="image" style="width:1%;">
            <a href="{{webapp_}}/user/{{user.user_id}}/">
              {% if user.has_photo %}
                <img src="{{webapp_}}/user/{{user.user_id}}/photo/"
                     alt="{{user.nickname|escape}}"
                     title="{{user.nickname|escape}}"/>
              {% else %}
                {% ifequal user.sex "male" %}
                  <img src="{{static_}}/images/male_no_photo.jpg"
                       alt="{{user.nickname|escape}}"
                       title="{{user.nickname|escape}}"/>
                {% else %}
                  <img src="{{static_}}/images/female_no_photo.jpg"
                       alt="{{user.nickname|escape}}"
                       title="{{user.nickname|escape}}"/>
                {% endifequal %}
              {% endif %}
            </a>
          </td>
          <td class="text">
            <div class="name">
              <a href="{{webapp_}}/user/{{user.user_id}}/">{{user.nickname|slice:":16"|escape}}</a>
            </div>
            <div class="information">
              <img src="{{static_}}/images/contrib_icon.gif" alt="Contribution points"/>
              {{user.points}} points
            </div>
          </td>
        </tr>
      {% endfor %}
    </tbody>
  </table>

</div>

<!-- add movie/sign in button ___________________________________________________________________-->

<div class="section">
  <div class="big_button">
    {% if user_ %}
      <a href="{{webapp_}}/add_movie/">Add a movie</a>
    {% else %}
      <a href="{{sign_in_url_}}">Sign in</a>
    {% endif %}
  </div><!--/.big_button-->
</div>

<!-- powered by _________________________________________________________________________________-->

<div class="section">
  <p>
    <!-- Selected from: http://www.python.org/community/logos/ -->
    <a href="http://www.python.org/" rel="external">
      <img src="http://www.python.org/community/logos/python-powered-w-100x40.png"
           alt="Python Powered"
           title="Python Powered"/>
    </a>
  </p>
  <p>
    <!-- Selected from: http://www.djangoproject.com/community/badges/ -->
    <a href="http://www.djangoproject.com/" rel="external">
      <img src="http://media.djangoproject.com/img/badges/djangomade124x25.gif"
           alt="Powered by Django"
           title="Powered by Django"/>
    </a>
  </p>
  <p>
    <!-- Selected from: http://code.google.com/appengine/downloads.html -->
    <a href="http://appengine.google.com/" rel="external">
      <img src="http://code.google.com/appengine/images/appengine-silver-120x30.gif"
           alt="Powered by Google App Engine"
           title="Powered by Google App Engine"/>
    </a>
  </p>
  <p>
    <!-- Selected from: http://buggarden.zhengzhong.net/logos/ -->
    <a href="http://buggarden.zhengzhong.net/" rel="external">
      <img src="http://buggarden.zhengzhong.net/logos/made_in_bug_garden_120x40.gif"
           alt="Made in Bug Garden"
           title="Made in Bug Garden"/>
    </a>
  </p>
</div>



